#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QPushButton* button_yes=new QPushButton(this);
    QPushButton* button_no=new QPushButton(this);
    button_no->setText("no");
    button_yes->setText("yes");
    button_no->move(200,200);
    button_yes->move(500,200);
    //设置提示信息
    button_no->setToolTip("按下按钮确定");
    button_yes->setToolTip("按下按钮取消");
    //设置提示时间,单位毫秒
    button_no->setToolTipDuration(7000);
    button_yes->setToolTipDuration(5000);
}
Widget::~Widget()
{
    delete ui;
}

